<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function Star(color, weight, brand, model) {
            this.color = color;
            this.weight = weight;
            this.brand = brand;
            this.model = model;
            this.play = function (arr) {
                console.log(arr);
            }
            this.play2 = function (arr2) {
                console.log(arr2);
            }
            this.play3 = function (arr3) {
                console.log(arr3);
            }
            this.play4 = function (arr4) {
                console.log(arr4);
            }
        }
        var dn = new Star('red', '18k', '拯救者', '20020515');
        dn.play('看电影');
        dn.play2('听音乐');
        dn.play3('打游戏');
        dn.play3('敲代码');
        for (var k in dn) {
            console.log(dn[k]);
        }
    </script>
</head>

<body>

</body>

</html>